var rule = {
    title: '甜圈短剧[短]',
    host: 'https://api.cenguigui.cn',
    url: '/api/duanju/api.php?classname=fyclass&offset=fypage',
    searchUrl: '/api/duanju/api.php?name=**&page=fypage',
    headers: {
        'User-Agent': 'Mozilla/5.0',
    },
    searchable: 2,
    quickSearch: 0,
    filterable: 0,
    limit: 20,
    double: false,
    play_parse: true,
    class_parse: $js.toString(() => {
    let html = request('https://mov.cenguigui.cn/', { headers: rule.headers });    //request(input, { headers: rule.headers });
    classes = [];
    let data = pdfa(html, ".d-flex button.btn.btn-light");
    data.map((it) => {
        let type_name = pdfh(it, "button&&Text").replace('🎬 ', '');
        classes.push({ type_id: type_name, type_name });
    });
}),
lazy: $js.toString(() => {
    let kurl = `https://api.cenguigui.cn/api/duanju/api.php?video_id=${input}&type=mp4`;
    if (/\.(m3u8|mp4)$/i.test(input)) { 
        input = { jx: 0, parse: 0, url: input }; 
    } else {
        input = { jx: 0, parse: 1, url: kurl }; 
    }
}),
    一级: $js.toString(() => {
        let d = [];
        let html = request(input, { headers: rule.headers });
        let data = JSON.parse(html).data;
        data.map((it) => {
            d.push({
                title: it.title,
                img: it.cover,
                year: it.copyright,
                desc: it.sub_title,
                url: it.book_id
            });
        });
        setResult(d);
    }),
    二级: $js.toString(() => {
        let url = `https://api.cenguigui.cn/api/duanju/api.php?book_id=${orId}`;
        let item = JSON.parse(request(url));
        let playUrls = item.data.map(item => `${item.title}$${item.video_id}`);
        VOD = {
            vod_name: item.book_name,
            type_name: item.category,
            vod_pic: item.book_pic,
            vod_content: item.desc,
            vod_remarks: item.duration,
            vod_year: '更新时间:' + item.time,
            vod_actor: item.author,
            vod_play_from: '甜圈短剧',
            vod_play_url: playUrls.join("#")
        };
    }),
    搜索: $js.toString(() => {
        let d = [];
        let html = request(input, { headers: rule.headers });
        let data = JSON.parse(html).data;
        data.map((it) => {
            d.push({
                title: it.title,
                img: it.cover,
                year: it.author,
                desc: it.type,
                url: it.book_id
            });
        });
        setResult(d);
    })
}